/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;



/**
 *
 * @author Tiago
 */
public class MenuPrincipal extends javax.swing.JFrame {

    /**
     * Creates new form MenuPrincipal
     */
    public MenuPrincipal() {
       
       initComponents();
    }
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        MenuDinamico = new javax.swing.JDesktopPane();
        jButtonClientes = new javax.swing.JButton();
        jButtonSobre = new javax.swing.JButton();
        jButtonFilmes = new javax.swing.JButton();
        jButtonReservas = new javax.swing.JButton();
        jButtonLocacoes = new javax.swing.JButton();
        jButtonLocadora = new javax.swing.JButton();
        jButtonSair = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Sistema Gesto de Video Locadora");
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setName("MenuPrincipal"); // NOI18N
        setResizable(false);

        MenuDinamico.setBackground(new java.awt.Color(240, 240, 240));

        jButtonClientes.setIcon(new javax.swing.ImageIcon("C:\\Users\\Tiago\\Dropbox\\ProjetoIntegrador\\ProjetoVideoLocadora\\img\\icones\\PNG\\Users.png")); // NOI18N
        jButtonClientes.setText("Clientes");
        jButtonClientes.setToolTipText("Clientes");
        jButtonClientes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonClientesActionPerformed(evt);
            }
        });

        jButtonSobre.setIcon(new javax.swing.ImageIcon("C:\\Users\\Tiago\\Dropbox\\ProjetoIntegrador\\ProjetoVideoLocadora\\img\\icones\\PNG\\48.png")); // NOI18N
        jButtonSobre.setText("Sobre");
        jButtonSobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSobreActionPerformed(evt);
            }
        });

        jButtonFilmes.setIcon(new javax.swing.ImageIcon("C:\\Users\\Tiago\\Dropbox\\ProjetoIntegrador\\ProjetoVideoLocadora\\img\\icones\\PNG\\35.png")); // NOI18N
        jButtonFilmes.setText("Filmes");
        jButtonFilmes.setToolTipText("Filmes");

        jButtonReservas.setIcon(new javax.swing.ImageIcon("C:\\Users\\Tiago\\Dropbox\\ProjetoIntegrador\\ProjetoVideoLocadora\\img\\icones\\PNG\\13.png")); // NOI18N
        jButtonReservas.setText("Reservas");
        jButtonReservas.setToolTipText("Reservas");

        jButtonLocacoes.setIcon(new javax.swing.ImageIcon("C:\\Users\\Tiago\\Dropbox\\ProjetoIntegrador\\ProjetoVideoLocadora\\img\\icones\\PNG\\Movie Document.png")); // NOI18N
        jButtonLocacoes.setText("Locações");
        jButtonLocacoes.setToolTipText("Locações");
        jButtonLocacoes.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonLocacoesActionPerformed(evt);
            }
        });

        jButtonLocadora.setIcon(new javax.swing.ImageIcon("C:\\Users\\Tiago\\Dropbox\\ProjetoIntegrador\\ProjetoVideoLocadora\\img\\icones\\PNG\\11.png")); // NOI18N
        jButtonLocadora.setText("Locadora");
        jButtonLocadora.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonLocadoraActionPerformed(evt);
            }
        });

        jButtonSair.setIcon(new javax.swing.ImageIcon("C:\\Users\\Tiago\\Dropbox\\ProjetoIntegrador\\ProjetoVideoLocadora\\img\\icones\\PNG\\2.png")); // NOI18N
        jButtonSair.setText("Sair");
        jButtonSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonSairActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButtonClientes, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonFilmes, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonReservas, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonLocacoes, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButtonLocadora, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButtonSobre, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButtonSair, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(MenuDinamico, javax.swing.GroupLayout.DEFAULT_SIZE, 1333, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButtonClientes, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonFilmes, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButtonReservas, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButtonLocacoes, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
                            .addComponent(jButtonLocadora, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
                            .addComponent(jButtonSobre, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButtonSair, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addGap(18, 18, 18)
                .addComponent(MenuDinamico, javax.swing.GroupLayout.PREFERRED_SIZE, 663, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        getAccessibleContext().setAccessibleName("Sistema Gestor de Video Locadoras");

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents
       
    

    private void jButtonSobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSobreActionPerformed
       Sobre sobre = new Sobre();
       sobre.setVisible(true);
       MenuDinamico.add(sobre);
    }//GEN-LAST:event_jButtonSobreActionPerformed

    private void jButtonLocacoesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLocacoesActionPerformed
       TelaLocacoes locacoes = new TelaLocacoes();
       locacoes.setVisible(true);
       MenuDinamico.add(locacoes);
    }//GEN-LAST:event_jButtonLocacoesActionPerformed

    private void jButtonClientesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonClientesActionPerformed
      TelaClientes clientes;
        try {
            clientes = TelaClientes.getInstance();
             clientes.setVisible(true);
             MenuDinamico.add(clientes);
        } catch (SQLException ex) {
            Logger.getLogger(MenuPrincipal.class.getName()).log(Level.SEVERE, null, ex);
        }
     
      
      
      
      
    }//GEN-LAST:event_jButtonClientesActionPerformed

    private void jButtonSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonSairActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jButtonSairActionPerformed

    private void jButtonLocadoraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonLocadoraActionPerformed
        TelaLocadora locadora = TelaLocadora.getInstance();
        locadora.setVisible(true);
        MenuDinamico.add(locadora);
    }//GEN-LAST:event_jButtonLocadoraActionPerformed

    /**
     * @param args the command line arguments
     */
   
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane MenuDinamico;
    private javax.swing.JButton jButtonClientes;
    private javax.swing.JButton jButtonFilmes;
    private javax.swing.JButton jButtonLocacoes;
    private javax.swing.JButton jButtonLocadora;
    private javax.swing.JButton jButtonReservas;
    private javax.swing.JButton jButtonSair;
    private javax.swing.JButton jButtonSobre;
    // End of variables declaration//GEN-END:variables
}
